<template>
  <div class="input-ctn"  @click="onInputClick">
    <div class="inner-ctn">
      <input 
        :style="{width: inputWidth}"
        :type="type" 
        readonly 
        :placeholder="placeholder"
        :value="inputValue"
      >
      <van-icon name="arrow-down" />
    </div>
    
  </div>
</template>

<script>
export default {
  props: {
    placeholder: {
      type: String,
      default: '请选择'
    },
    type: {
      type: String,
      default: 'text'
    },
    inputWidth: {
      type: String,
      default: '100%'
    },
    inputValue: {
      type: String,
    },
  },
  mounted() {
    console.log('input:', this.inputWidth);
  },
  methods: {
    onInputClick() {
      this.$emit('input-click')
    }
  }
}
</script>

<style lang="less" scoped>
.input-ctn {
  display: inline-block;
  padding: 5px 10px;
  font-size: 12px;
  width: 100%;
  
  .inner-ctn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #f3f3f3;
    background: #ffffff;

    padding: 5px;
    border-radius: 5px;
    // height: 30px;
    // line-height: 30px;
    box-sizing: border-box;
    
  }
  input {
    // border: 1px solid #f3f3f3;
    // padding: 5px;
    // border-radius: 5px;
    // height: 30px;
    // line-height: 30px;
    // width: 80px;
    // width: auto;
  }
}

</style>